from app.model.base import *
from sqlalchemy import Index
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy import Column, String, TIMESTAMP, text

from app.model.base import *
from sqlalchemy import Index
import uuid
class Chat(Base):
    __tablename__ = 'chat'
    __table_args__ = {'comment': 'Chat'}

    id = Column(BIGINT(20), primary_key=True, comment='id')
    user_id = Column(BIGINT(20), comment='用户id')
    group_id = Column(BIGINT(20), comment='群主id')
    ai_id = Column(BIGINT(20), comment='ai_id')
    last_msg_id = Column(BIGINT(20), comment='最后一条消息id')
    
 
indexes=[Index('chat_ix', Chat.ai_id), Index('ai_mix_ix', Chat.is_deleted, Chat.ai_id), Index('user_mix_ix', Chat.is_deleted, Chat.user_id), Index('group_mix_ix', Chat.is_deleted, Chat.group_id)]

